#!/usr/bin/perl
use strict;
use warnings;

sub find_string {
  open my $fh,"<", "batfile" or die "Cannot open file $!";
  my $find = "SET CHECKPOINT=";
  my @lines = <$fh>;
  my $variable;
  foreach (@lines) {
    chomp $_;
    $variable = $_;
    if ($variable =~ /^$find/) {
      #return $variable;
      }
    if ($variable =~ /%SVN_SERVER(.*?)\/%CHECKPOINT/) {
       my $list = $1;
       print $list, $variable;
      } 
   }
}
my @newlist = find_string();
foreach (@newlist) {
  print "$_\n";
}
